/*
 * Licensed this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 *
 * AUTHOR: Sebastian Ritter
 */
using System;
using System.Collections.Generic;
using System.Text;

namespace org.boapi.ui.util {
  /// <summary>
  /// Type with util methods for GUI based application and the UPLI.
  /// </summary>
  /// <see cref="org.boapi.finance.MasterCard"/>
  public class CreditCardUIHelper {
    /// <summary>
    /// Returns input patterns for the real world of credit cards
    /// </summary>
    /// <param name="businessObjects"></param>
    /// <returns></returns>
    public static String getMaskForBO (Type businessObjects) {
      if (typeof (org.boapi.finance.VisaCard) == businessObjects) return "4000 0000 0000 0000";
      if (typeof (org.boapi.finance.MasterCard) == businessObjects) return "5000 0000 0000 0000";
      if (typeof (org.boapi.finance.AmericanExpress) == businessObjects) return "3000 000000 00000";
      if (typeof (org.boapi.finance.DinersClub) == businessObjects) return "3000 0000 0000 00";
      if (typeof (org.boapi.finance.CarteBlanche) == businessObjects) return "0000 0000 0000 00";
      return "0000000000000000000";
    }
  }
}

/*
 * cardname                         startnumbers                        sample
 * 
 * Visa                             4                                   4111 1111 1111 1111
 * Master                           51,52,53,54,55                      5500 0000 0000 0004
 * Diner's Club                     30,36,38                            3000 0000 0000 04
 * Carte Blanche                    30,36,38                            3000 0000 0000 04
 * American Express                 34, 37                              3400 0000 0000 009
 * Discover                         6011                                6011 0000 0000 0004
 * en Route                         2014, 2149                          2014 0000 0000 009
 * JCB                              3088,3096,3112,3158,3337,3528       3088 0000 0000 0009
 * Manufacturers Hanover Trust      1033
 * Citibank                         1035, 5424
 * Chemical Bank                    1263
 * Chase Manhattan                  1665
 * Bank of America                  4024
 * Citicorp                         4128
 * New Era Bank                     4209
 * HHBC                             4302
 * Imperial Savings                 4310
 * MBNA                             4313, 6017
 * California Federal               4317
 * Wells Fargo                      5282, 5410
 * Bank of New York                 5432
 */